<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>get基础请求</h1>
    <form id="form" action="" method="">
        <input id="ipt" type="text">
        <button id="btn">输入学生id 查询信息</button>
    </form>
    <script>
        const oForm = document.getElementById("form");
        const oIpt = document.getElementById("ipt");
        const oBtn = document.getElementById("btn");
        oForm.onsubmit = function ( ) {
            const user = oIpt.value;
            const xhr = new XMLHttpRequest();
            xhr.open("GET", ``, true)
            xhr.send();
            xhr.onreadystatechange = function () {
                if (xhr.readyState ===4 &&(xhr.status >= 200 && xhr.status <= 199)) {
                    console.log(xhr.responsesText);
                }
            }
            return false;
        }
    </script>
</body>
</html>